//
//  RHInputOutputItemCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/10/25.
//

#import "RHInputOutputItemCell.h"

@implementation RHInputOutputItemCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame]){
        [self setupUI];
    }
    return self;
}

-(void)setupUI
{
    UIView *bgView = kView;
    bgView.backgroundColor = [UIColor colorWithHexString:@"56C271" alpha:0.1];
    bgView.layer.cornerRadius = 8;
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    self.bgView = bgView;
    
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
    }];
    
    _imageView = [[UIImageView alloc]init];
    [self.contentView addSubview:_imageView];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.offset(kScaleW(35));
        make.centerY.mas_offset(0);
        make.left.mas_offset(15);
    }];
    
    _contentLab = [[QMUILabel alloc]init];
    _contentLab.text = @"85,796";
    _contentLab.font = [UIFont boldSystemFontOfSize:16];
    _contentLab.textAlignment = NSTextAlignmentLeft;
    _contentLab.textColor = kCOLOR_HEX(@"3F4443");
    [self.contentView addSubview:_contentLab];
    
    _titleLab = [[QMUILabel alloc]init];
    _titleLab.text = @"累计装机容量";
    _titleLab.font = [UIFont systemFontOfSize:13];
    _titleLab.textAlignment = NSTextAlignmentLeft;
    _titleLab.textColor = kCOLOR_HEX(@"3F4443");
    [self.contentView addSubview:_titleLab];
    
    kWeakSelf;
    [_contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.imageView.mas_right).offset(kScaleW(15));
        make.top.mas_offset(15);
        make.right.mas_offset(-15);
    }];
    
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentLab);
        make.bottom.mas_offset(-15);
        make.right.mas_offset(-15);
    }];
}
@end
